package crawlingtosea.shapes
{
	import flash.display.Sprite;
	
	/**
	 * 
	 * @author mengtianwxs
	 * @createTime 2013-8-27
	 */
	
	public class DottedLine extends Sprite
	{
		
		
		protected var _hei:Number=3.0;
		protected var _bai:Number=2.0;
		protected var _heng:int=0;
		protected var _shu:int=1;
		protected var _length:Number=15;
	
		
		public function DottedLine(length:Number=15.0,direction:int=0)
		{
			super();
		
              drawDottedline(length,direction);
			
		}
		
		protected function drawDottedline(length:Number,direction:int):void
		{
			graphics.clear();
			graphics.lineStyle(1);
			if(direction==0)
			{
				for(var i:int=0;i<Math.floor(length/5);i++)
				{
					
					
					graphics.moveTo((_hei*(i+1)+_bai*(i+1)),0);
					graphics.lineTo(_hei+(_hei*(i+1)+_bai*(i+1)),0);
					//trace((_hei*(i+1)+_bai*(i+1)));
				}
				
			}
			else
			{
				for(var j:int=0;j<Math.floor(length/5);j++)
				{
					
					
					graphics.moveTo(0,(_hei*(j+1)+_bai*(j+1)));
					graphics.lineTo(0,_hei+(_hei*(j+1)+_bai*(j+1)));
					//trace((_hei*(i+1)+_bai*(i+1)));
				}
				
			}
			graphics.endFill();
			this.x=-5;
		}
		
		
	}
}